<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>My JSP 'MyJsp.jsp' starting page</title>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/easyui/1.3.4/themes/default/easyui.css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/wu.css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/icon.css" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.0.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/easyui/1.3.4/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/easyui/1.3.4/locale/easyui-lang-zh_CN.js"></script>
	<style type="text/css">
		.panel1{
			float:left;
			margin-bottom: 2px;
			margin:20px 20px 20px 20px;
		}
		.panel2{
			float:left;
			margin-left: 20px;
			margin:20px 20px 20px 20px;
		}
		.imgdiv{
			width: 70px;
			float: left;
			text-align: center;
			margin: 25px 15px 0px 15px
		}
	</style>
	<script type="text/javascript">
		$(function(){
			$('#showtaskinfo').datagrid({   
			    url:'${pageContext.request.contextPath}/task?op=deskshow',  
			    fitColumns : true, 
			    columns:[[   
			        {field:'userByStartuser',title:'任务名称',width:200,
			        	formatter: function(value,row,index){
							return value.realname+row.tasktype.name;
						}
			        },
			        {field:'tasktype',title:'类型',hidden:true}, 
			        {field:'state',title:'状态',width:100,
			        	formatter: function(value,row,index){
			        		if(value==1){
			        			return "已处理";
			        		}
							return "未处理";
						}
			        },   
			         {field:'caozuo',title:'操作',width:60,
		        	formatter:function(value,row,index){
		        	if(row.userByStartuser.id==($('#b').val())){
		        		return "<a href='${pageContext.request.contextPath}/task?op=taskid&id="+row.id+"'>查看</a>";
		        		}else{
		        		return "<a href='${pageContext.request.contextPath}/task?op=taskid&id="+row.id+"'>审核</a>";
		        		}
		        	}
		        	}
			    ]]   
			});
			$('#wintask').panel({   
			  width:360,   
			  height:220,   
			  title: '待处理的任务',
			  iconCls:'icon-flag-green',  
			  tools: [{   
			    iconCls:'icon-search',   
			    handler:function(){
			    	location.href='${pageContext.request.contextPath}/tasktable.jsp';
			    } 
			  }]   
			});  
		});
		
		$(function(){
			$('#winnote').panel({   
			  width:360,   
			  height:220,   
			  title: '通知公告',
			  iconCls:'icon-flag-green', 
			  tools: [{   
			    iconCls:'icon-add',   
			    handler:function(){
			    	location.href ='${pageContext.request.contextPath}/filter?op=notice';
			    } 
			  }]   
			});  
		});
		
	$(function() {
		$('#winnotice').panel({
			width : 360,
			height : 220,
			title : '我的便笺',
			iconCls : 'icon-flag-green',
			tools : [ {
				iconCls : 'icon-add',
				handler : function() {
					location.href ='${pageContext.request.contextPath}/filter?op=note';
				}
			} ]
		});
	});
		
		$(function(){
			$('#winusual').panel({   
			  width:360,   
			  height:220,   
			  title: '常用工具任务',
			  iconCls:'icon-flag-green',  
			});  
		});
		$(function(){
			$('#pp').pagination({   
            total:2000,   
            pageSize:10   
});  			
		})
		$(function(){
			$('#tg').datagrid({   
				    url:'${pageContext.request.contextPath}/notice?op=show7',   
				    columns:[[ 
				    	
				    	{field:'tital',title:'标题',width:180,
				    		formatter: function(value,row,index){
									return '<a style="color:blue" href="${pageContext.request.contextPath}/notice?op=show3&id='+row.id+'">'+row.tital+'</a>';							
							}		
				    	},   
				        {field:'startshow',title:'日期',width:100}
				        
				    		]],
				    striped:true,
				    fitColumns : true,
					loadMsg : '请等待...',		
				})
		})
		$(function() {
		
		var id = $('#b').val();
		$('#bq').datagrid({
			url : 'note?op=show',
			queryParams : {
				id : id,
			},
			columns : [ [ {
				field : 'tital',
				title : '标题',
				width : 180,
			}, {
				field : 'content',
				title : '内容',
				width : 180,
			} ] ],
			fitColumns : true,
			autoRowHeight : false,
			striped : true,
			loadMsg : '请等待...',
			pagination : true,
			nowrap : true,
			rownumbers : true,
			fit : true,
		});
	});
</script>
  </head>
  <input type="hidden" id="b" value="${sys_user.id }">
  <body>
  	<div class="panel1">
	    <div id="wintask"style="background:#fafafa;">	    
	  		<table id="showtaskinfo"></table>
		</div>
	</div>	
  	<div class="panel1">
			<div id="winnote" style="background: #fafafa;">
				<table id="tg"></table>
			</div>
		</div>
	<div style="clear: both;"></div>
	<div class="panel2">
		<div id="winnotice"style="background:#fafafa;">   
			<table id="bq"></table>   
		</div>
	</div>	
	<div class="panel2">
		<div id="winusual"style="background:#fafafa;">   
	    	<div class="imgdiv"  style="margin-left: 40px">
	    		<a href="${pageContext.request.contextPath}/internet.jsp"><img src="${pageContext.request.contextPath}/images/web.png" width="50" height="50"></img></a><br/>
	    		常用网址
	    	</div>
	    	<div class="imgdiv">
	    		<a href="${pageContext.request.contextPath}/showyear.htm"><img src="${pageContext.request.contextPath}/images/calendar.png" width="50" height="50"></img></a><br/>
	    		日历查询
	    	</div>
	    	<div class="imgdiv">
	    		<a href="${pageContext.request.contextPath}/shedule.jsp"><img src="${pageContext.request.contextPath}/images/richeng.png" width="50" height="50"></img></a><br/>
	    		日程管理
	    	</div>   
		</div>
	</div>	
  </body>
</html>
